/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package util;

import java.util.Date;
import java.util.logging.FileHandler;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author WMThiet
 */
public class MyLog {
    public static void WriteLog(Object obj,String message){
        
        String mes = new Date().toString().concat(": ").concat(message).concat("\n");
        
        try{
            FileHandler handler = new FileHandler("my.log", true);            
            Logger logger = Logger.getLogger("com.p2tbid");
            logger.addHandler(handler);
            
            logger.log(Level.SEVERE, mes);
            
        }catch(Exception ex){            
        }
    }
}
